package com.cgq.pro.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cgq.base.service.impl.BaseServiceImpl;
import com.cgq.pro.dao.AttachmentDao;
import com.cgq.pro.entity.Attachment;
import com.cgq.pro.service.AttachmentService;

@Service
public class AttachmentServiceImpl extends BaseServiceImpl<Attachment> implements
		AttachmentService {

	private AttachmentDao attachmentDao;
	
	@Autowired
	public void setAttachmentDao(AttachmentDao attachmentDao) {
		this.attachmentDao = attachmentDao;
		this.baseDao=attachmentDao;
	}

	public List<Attachment> findByBusinessIdAndTypeAndId(String businessId,
			String businessType,String id) {
		return attachmentDao.findByBusinessIdAndTypeAndId(businessId, businessType,id);
	}

	public boolean deleteAndPhoto(String id,String path) {
		return attachmentDao.deleteAndPhoto(id, path);
	}

	public boolean deleteAndAttachment(String[] ids, String path) {
		return attachmentDao.deleteAndAttachment(ids, path);
	}

}
